const categories = require("express").Router();
const { Validator, category } = require("../../../validators");
const CategoryController = require("../../../controllers/category");
// 获取分类列表
categories.get("/", CategoryController.list);
// 添加分类
categories.post("/", Validator(category.add), CategoryController.add);
// 删除分类
categories.delete(
    "/:id",
    Validator(category.delete),
    CategoryController.delete
);
// 修改分类
categories.patch("/:id", Validator(category.update), CategoryController.update);
// 获取分类下的图库列表
categories.get(
    "/:id/galleries",
    Validator(category.galleries),
    CategoryController.galleries
);
module.exports = categories;
